package com.blog.cloud.controller.bac.grab;

import java.io.File;
import java.util.List;

import com.blog.cloud.comm.modal.pojo.Tags;
import com.blog.cloud.controller.base.BaseController;
import com.blog.cloud.dao.TagsDao;
import com.blog.cloud.dao.UserUploadInfDao;
import com.blog.cloud.service.bac.grab.GrabService;
import com.jfinal.core.ActionKey;

public class GrabController extends BaseController {
	
	
	
	
	@ActionKey("initGalleryData")
	public void inintGalleryData(){
		
		GrabService.ser.initGalleryData();
		
	}

	@ActionKey("Test")
	public void addPic(){
		
		
		List<Tags> geetTags = TagsDao.me.geetTags();
		
		
		
		
		
		String path = "D:\\Manipula\\Manipula\\pic\\p-clazz";
		
		
		File file = new File(path);
		File[] listFiles = file.listFiles();
		for (File file2 : listFiles) {
			if(file2.isDirectory()){
				int index = 0;
				for (int i = 0; i < geetTags.size(); i++) {
					Tags tags = geetTags.get(i);
					if(!file2.getName().equals(tags.getTagNo())){
						index ++;
					}else{
						break;
					}
				}
				if(index==geetTags.size()){
					System.out.println(file2.getName());
				}
			}
		}
	}

}
